package com.gt.quality.base.pojo.enump;

import lombok.Getter;

/**
 * 工单状态
 */
@Getter
public enum OrderStatus {
    NOT_RESOLVE(1, "未处理"),
    RESOLVING(2, "处理中"),
    RESOLVED(3, "已处理"),
    CLOSED(4, "已关闭"),
    RETURN(5, "被打回");

    private final int code;
    private final String name;

    OrderStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrderStatus getByCode(int code){
        for (OrderStatus status : OrderStatus.values()) {
            if(status.code == code){
                return status;
            }
        }
        return NOT_RESOLVE;
    }
}
